import { IScheduleWarningConfig } from "@core/lj-interface";
import { IFile } from "@core/lj-interface";
export interface FactorCodeValue {
  factorCode: string;
  factorName: string;
  factorSort: number;
  factorType: number;
  resultType: number;
  label?: string;
  value?: string;
}

export interface ConditionFieldCode extends FactorCodeValue {
  factorCode: string;
  factorName: string;
  factorSort: number;
  factorType: number;

  resultType: number;
  label?: string;
  value?: string;
}

export interface ConditionItem {
  dataVersion?: number;
  delFlag?: number;
  expressionValue: string;
  fieldCode: string;
  id?: string;
  leftBracket: string;
  logicalOperator: string;
  operator: string;
  quotaId: string;
  remark?: "";
  rightBracket: string;
  sort?: number;
  type?: number;
}
export interface RuleItems {
  configId?: string;
  dataVersion?: number;
  delFlag?: number;
  id?: string;

  quotaId: string;
  quotaName?: string;
  quotaRemark: string;
  quotaUnit: string;
  value: string;
}

export interface Ranges {
  configId?: string;
  dataVersion?: any;
  delFlag?: any;

  id?: string;

  rangeId: string;
  rangeName: string;

  type: number;
}

export interface RiskRow extends IScheduleWarningConfig {
  /**
   * 业务类型
   */
  busName: string;
  cron: string;
  /**
   * 指定人员
   */
  notifierFieldName: string;
  conditions: ConditionItem[];
  items: RuleItems[];
  busCode: string;
  busCodeJoinBusType: string;
  notifierChoices: number[];
  rangeTypes: number[];
  rangeTypeSupplier: number;
  rangeTypeCustomer: number;
  rangeTypeProject: number;
  projectRanges?: Ranges[];
  customerRanges?: Ranges[];
  supplierRanges?: Ranges[];
  ranges?: Ranges[];
  letterStatus: number;
  letterTime: number;
  configName: string;
  refCompanyName: string;
  handleUserName: string;
  handleRemark: string;
  notifierFieldCode: string;
  letterFile: IFile;
  businessInfos: {
    dataVersion?: number;
    delFlag?: number;
    fieldCode: string;
    fieldName: string;
    fieldShowFlag?: number;
    fieldSort?: number;
    fieldType?: number;
    fieldValue: string;
    id: string;
    logId: string;
  }[];
  letterId: string;
  refCompanyId: string;
}
